package com.example.logistics_manage.pojo.dto;

import com.example.logistics_manage.pojo.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserDto {
    private Integer userId;
    private String userName;
    private String password;
    private Integer userRole;

    private String roleName;
    private Integer jobId;
    private Long phone;
    private String token;
    private Integer code;
    private String image;

    public UserDto(User user,String token){
        this.userId = user.getUserId();
        this.userName = user.getUserName();
        this.userRole = user.getUserRole();
        this.jobId = user.getJobId();
        this.token = token;
        this.phone = user.getPhone();
        this.image = user.getImage();

    }

    public UserDto(User user){
        this.userId = user.getUserId();
        this.userName = user.getUserName();
        this.userRole = user.getUserRole();
        this.jobId = user.getJobId();
        this.phone = user.getPhone();
        this.code = user.getCode();
        this.image = user.getImage();
    }
}
